package com.lorenzogao.pley.ui.fragment


import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import com.lorenzogao.pley.R

/**
 * 作者：Lorenzo Gao
 * Date: 2017/12/28
 * Time: 18:17
 * 邮箱：2508719070@qq.com
 * Description:
 */
class GuideFragment : Fragment() {


    companion object {
        fun newInstance(imgResID: Int): GuideFragment {

            var fragment=GuideFragment()


            var bundle=Bundle()

            bundle.putInt("IMG_ID",imgResID)

            fragment.arguments=bundle


            return fragment
        }
    }

    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View {
        var view = inflater!!.inflate(R.layout.fragment_guide, container, false)

        initData(view)
        return view
    }

    private fun  initData(view: View){

        var args=arguments

        var iv_background=view.findViewById(R.id.iv_fguide_img) as ImageView

        iv_background.setBackgroundColor(resources.getColor(args.getInt("IMG_ID")))



    }

}